
import socket

client = socket.socket()

server_ip_port = ('127.0.0.1',8001)

client.connect(server_ip_port)

while 1:
    to_server_msg = input('给服务端的消息>>>').encode('utf-8')
    client.send(to_server_msg)
    from_server_msg = client.recv(1024).decode('utf-8')
    print('来自服务端的消息>>>',from_server_msg)


























